package com.yonyou.cyxdms.sysAuth.service.controller.area;

import com.yonyou.cyxdms.sysAuth.service.dto.CompanyDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.OrgDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.area.AttachAreaDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.area.OrgNameDTO;
import com.yonyou.cyxdms.sysAuth.service.entity.OrgPO;
import com.yonyou.cyxdms.sysAuth.service.service.areaService.DealerAttchAreaservice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/orgId")
@Api(value = "查询区域", tags = {"查询区域"})
public class SerectOrgName {

    @Autowired
    private DealerAttchAreaservice dealerAttchAreaservice;

    @GetMapping(value = "selectOrgName/{orgId}")
    @ApiOperation(value = "根据组织id查询区域名称",notes = "根据组织id",httpMethod = "GET")
    @ApiImplicitParams({@ApiImplicitParam(value = "组织id" , name = "orgId" , readOnly = true, dataType = "Long" ,paramType = "header")})
    public List<AttachAreaDTO> selectName(@PathVariable("orgId") Long orgId) {
        return this.dealerAttchAreaservice.selecOrgName(orgId);
    }
}
